<div class="col-md-9">
  <div class="thumbnail"> 
    <!-- breadcrumb -->
    <ol class="breadcrumb breadcrumb-arrow">
      <li><a href="{:U(GROUP_NAME . '/Rbac')}">RBAC</a></li>
      <li class="active"><span>用户列表</span></li>
    </ol>

    <table class="table">
      <caption><h3>用户列表</h3></caption>
      <thead>
        <tr>
          <th>ID</th>
          <th>用户名</th>
          <th>用户邮箱</th>
          <th>学号</th>
          <th>查看详细</th>
          <th>状态</th>
          <th>配置角色</th>
          <th>修改资料</th>
          <th>删除</th>
        </tr>
      </thead>
      <tbody>
        <volist name="user" id="u">
          <tr>
            <td>{$u.p_id}</td>
            <td>{$u.p_name}</td>
            <td>{$u.email}</td>
            <td>{$u.s_id}</td>
            <td>
              <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="right" data-original-title="
              <div class='text-left'>
                [p_id] => {$u.p_id} <br>
                [p_name] => {$u.p_name} <br>
                [password] => {$u.password} <br>
                [email] => {$u.email} <br>
                [s_id] => {$u.s_id} <br>
                [birthday] => {$u.birthday} <br>
                [login] => {$u.login} <br>
                [reg_ip] => {$u.reg_ip} <br>
                [reg_time] => {$u.reg_time} <br>
                [last_login_ip] => {$u.last_login_ip} <br>
                [last_login_time] => {$u.last_login_time} <br>
                [lock] => {$u.lock}
              </div>
              ">
                查看详细
              </button>
            </td>
            <td>{$u.status}</td>
            <td>
              <a href="{:U(GROUP_NAME . '/Rbac/userRole', array('id' => $u['p_id']))}">配置角色</a>
            </td>
            <td>
              <button class="btn btn-primary" data-toggle="modal" data-target="#modal{$u.p_id}">
                修改资料
              </button>
            </td>
            <td>
              <form action="{:U(GROUP_NAME . '/Rbac/delUser')}" method="post">
                <input type="hidden" name="p_id" value="{$u.p_id}">
                <input type="submit" class="btn btn-danger" value="删除用户" onclick="return confirm('确定将此用户删除?')">
              </form>
              
            </td>
          </tr>
        </volist>
        
      </tbody>
    </table>
  </div>
</div>


<!-- 修改资料Modal -->
<volist name="user" id="u">
  <div class="modal fade" id="modal{$u.p_id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title" id="myModalLabel">修改资料</h4>
        </div>
        
        <form class="form-horizontal" role="form" method="post" action="{:U(GROUP_NAME . '/Rbac/modifyUser')}">
          <div class="modal-body">
            <!-- 编号 -->
            <div class="form-group">
              <label for="p_id" class="col-sm-2 control-label">编号</label>
              <div class="col-sm-7">
                <input type="text" class="form-control" id="p_id" name="p_id" value="{$u.p_id}" readonly>
              </div>
            </div>
            <!-- 用户名 -->
            <div class="form-group">
              <label for="p_name" class="col-sm-2 control-label">用户名</label>
              <div class="col-sm-7">
                <input type="text" class="form-control" id="p_name" name="p_name" value="{$u.p_name}">
              </div>
            </div>
            <!-- 邮箱 -->
            <div class="form-group">
              <label for="email" class="col-sm-2 control-label">邮箱</label>
              <div class="col-sm-7">
                <input type="email" class="form-control" id="email" name="email" value="{$u.email}">
              </div>
            </div>
            <!-- 学号 -->
            <div class="form-group">
              <label for="s_id" class="col-sm-2 control-label">学号</label>
              <div class="col-sm-7">
                <input type="text" class="form-control" id="s_id" name="s_id" value="{$u.s_id}">
              </div>
            </div>
            <!-- 状态 -->
            <div class="form-group">
              <label for="s_id" class="col-sm-2 control-label">状态</label>
              <if condition="$u['status']">
                <div class="radio-inline">
                  <input type="radio" name="status" id="status" value="1" checked>
                  开启
                </div>
                <div class="radio-inline">
                  <input type="radio" name="status" value="0">
                  关闭
                </div>
              <else />
                <div class="radio-inline">
                  <input type="radio" name="status" id="status" value="1">
                  开启
                </div>
                <div class="radio-inline">
                  <input type="radio" name="status" id="" value="0" checked>
                  关闭
                </div>
              </if>
            </div>
          </div>
          
          <div class="form-group">
            <div class="col-sm-offset-2 col-sm-7">
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" class="btn btn-primary">提交保存</button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</volist>  

<script>
  $('.table').tooltip({
    selector: "[data-toggle=tooltip]",
    container: "body",
    html: true
  })


</script>
